<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    * {
      margin: 0;
      padding: 0;
    }

    html,
    body {
      /* display: flex; */

      display: grid;
      /* Grid 用法: (align-items 和 justify-items 属性的简写形式) */
      place-items: center;
      width: 100vw;
      height: 100vh;
      background-color: #333;
    }

    .box {
      width: 200px;
      height: 200px;
      background-color: pink;
    }
  </style>
</head>
<body>
  <div class="box">demo</div>
</body>
</html>